<?php
ini_set('session.auto_start', true);
date_default_timezone_set('Asia/Saigon');
header ("Expires: Mon, 26 Jul 2009 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate, no-store, post-check=0, pre-check=0");
header ("Pragma: no-cache");
ob_start(); 
define('ROOT_DIR'		, realpath('../' . dirname(basename(__FILE__))));
define('ROOT_LIBRARY'	, ROOT_DIR . '/library');
$strHttpPost			= $_SERVER["HTTP_HOST"];
if(	$strHttpPost == 'admin.diadiemhoctap.dev' || $strHttpPost == 'admin.diadiemhoctap.vn') {
	require_once ROOT_DIR . '/backend/Bootstrap.php';
}
else {
	require_once ROOT_DIR . '/frontend/Bootstrap.php';
}
$strHttpPost	= str_replace(array('admin.','www.'),array('',''),$strHttpPost);
define('DOMAIN'			, $strHttpPost);
define('MOD_NAME'		, 'ddht');
define('MOD_FRONTEND'	, 'frontend/' . MOD_NAME);	
define('FRONTEND_NAME'	, MOD_NAME . '/');
$objBootstrap = new Bootstrap();
$objBootstrap->runApp();
ob_end_flush();